package com.k8.rpc.invoke;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

//todo
public class InvokerManager {
    ConcurrentHashMap<String, Invoker> cacheInvoker = new ConcurrentHashMap<>();
    Lock lock = new ReentrantLock(false);

    public Invoker getInvoker(String invokerKey) {
        return cacheInvoker.get(invokerKey);
    }

    public Lock getLock() {
        return this.lock;
    }

    public void putInvoker(String invokerKey, Invoker invoker) {
        cacheInvoker.put(invokerKey, invoker);
    }

    public void destroy() {

    }
}
